package top.laoshuzi.rpi3

//import kotlinx.cinterop.*
import lib.bcm2835.*

fun main(args: Array<String>) {

    val pin = RPI_GPIO_P1_11.toUByte()

    if (bcm2835_init() == 0) {
        println("bcm2835初始化失败")
        return
    }

    bcm2835_gpio_fsel(pin, BCM2835_GPIO_FSEL_OUTP.toUByte())

    while (true) {

        bcm2835_gpio_write(pin, HIGH)
        bcm2835_delay(1000)

        bcm2835_gpio_write(pin, LOW)
        bcm2835_delay(1000)
    }

    bcm2835_close()
}